
<?php
 error_reporting(E_ALL);
 ini_set("display_errors", 1);
?>

<?php
if(   !  isset($_POST['ubmitSay']))
{
?>
	<form method="POST" action="DebugScript.php" >
	Script to debug:&nbsp;
<?php
	$dp = opendir('.') or die("Cannot open directory");
	echo "<select name=\"dbgScript\">\n";
	while($file = readdir($dp)){
		if( ! is_dir($file))
			echo "<option value=\"" . $file . "\">" . $file . "</option>\n";
	}
	echo "</select>\n";
	closedir($dp);

?>	
	
<br /> 
	<input type="submit" name="ubmitSay" value="Debug it" /> <br />
	</form>

<?php
}
else
{
	$dbgScript = $_POST['dbgScript'];
	include("$dbgScript");
}
?>

